1. Field of the Invention
The present invention relates to comparator circuits and, more particularly, to a method and an associated circuit and of using two comparators to separately compare an input signal of variable amplitude with an upper threshold value and a lower threshold value.
2. Discussion of Prior Art
In many electronic circuits, it is desirable to convert an analog sensor output from an analog signal to a digital signal prior to a desired signal processing operation. One prior art solution to convert an analog signal to a digital signal is by using a comparator to logically compare an electrical property of an analog signal input with another input signal such as a nominal desired threshold. This electrical property can be voltage, amperage, or the like. When the electrical property value of the analog signal input crosses the threshold, the output of the comparator transitions.
At times, background noise is superimposed on the analog signal input. This superposition can create various undesirable amplitude changes on the analog signal input. The background noise can add peaks and valleys to the amplitude of the analog signal input. As these amplitude variations pass through a comparator, the variations can frequently pass back and forth through the threshold level. This frequent amplitude transition across the threshold will also create a frequent transition in the comparator output signal and is often called bounce. This bounce characteristic is often undesirable, and a feedback circuit is sometimes used to control the bounce.
In order to eliminate some degree of bounce, a comparator may use hysteresis to limit the number of times the analog signal input effectively crosses the threshold. A nominal threshold is selected, in addition to an upper threshold and a lower threshold. The nominal threshold represents the amplitude where the desired output from the comparator is to change. The upper threshold is higher than the nominal threshold, and the comparator signal does not change until the analog signal input crosses the upper threshold. Similarly, the comparator output will not change again until the analog signal input drops below the lower threshold, which is below the nominal threshold. As a result, the hysteresis of the comparator is used to eliminate the spurious switches in comparator output created by the superimposed noise level on the analog signal input. The upper threshold and lower threshold are selected to minimize the bounce while maintaining an accurate comparator output relative to where the analog input signal crosses the nominal threshold.
The typical feedback circuit uses this application of hysteresis and a single comparator to evaluate when the analog signal input crosses the upper threshold level and the lower threshold level. After the analog signal input crosses the upper threshold, the feedback circuit will switch the comparator to use the lower threshold. However, in some situations, the analog signal input can initially cross the upper threshold and then cross below the upper threshold before the hysteresis is able to switch to the lower threshold. This situation creates spurious comparator output in the form of rapid fluctuation, or bounce. The bounce will foul the signal processing that occurs in subsequent circuit components. Additionally, this typical solution using a feedback circuit may have propagation delay which will generate an undesired phase shift in the resultant output waveform.
As such, there is a need for improvements in methods and circuits.